Adapt to object path conventions
authorMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2011 02:58:20 +0000 (21:58 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Dec 2011 17:45:51 +0000 (12:45 -0500)
Seems common to expect 'path == bus name with slashes'.

tests/testgmenu.c

index 1f8b0d79f385f557b342180a7bc3d77308fd761e..71006addf3bfddf492e9dc1a65100da19dd30bfb 100644 (file)
@@ -920,6 +920,9 @@ button_clicked (GtkButton  *button,
   gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, 0);
 }
 
+#define BUS_NAME "org.gtk.TestMenus"
+#define OBJ_PATH "/org/gtk/TestMenus"
+
 int
 main (int argc, char *argv[])
 {
@@ -958,9 +961,9 @@ main (int argc, char *argv[])
   if (do_import)
     {
       g_print ("Getting menus from the bus...\n");
-      model = (GMenuModel*)g_menu_proxy_get (bus, "org.gtk.TestMenus", "/path");
+      model = (GMenuModel*)g_menu_proxy_get (bus, BUS_NAME, OBJ_PATH);
       g_print ("Getting actions from the bus...\n");
-      group = (GActionGroup*)g_dbus_action_group_new_sync (bus, "org.gtk.TestMenus", "/path", 0, NULL, NULL);
+      group = (GActionGroup*)g_dbus_action_group_new_sync (bus, BUS_NAME, OBJ_PATH, 0, NULL, NULL);
     }
   else
     {
@@ -976,19 +979,18 @@ main (int argc, char *argv[])
   if (do_export)
     {
       g_print ("Exporting menus on the bus...\n");
-      if (!g_menu_exporter_export (bus, "/path", model, &error))
+      if (!g_menu_exporter_export (bus, OBJ_PATH, model, &error))
         {
           g_warning ("Menu export failed: %s", error->message);
           exit (1);
         }
       g_print ("Exporting actions on the bus...\n");
-      if (!g_action_group_exporter_export (bus, "/path", group, &error))
+      if (!g_action_group_exporter_export (bus, OBJ_PATH, group, &error))
         {
           g_warning ("Action export failed: %s", error->message);
           exit (1);
         }
-      g_bus_own_name_on_connection (bus, "org.gtk.TestMenus",
-                                    0, NULL, NULL, NULL, NULL);
+      g_bus_own_name_on_connection (bus, BUS_NAME, 0, NULL, NULL, NULL, NULL);
     }
   else
     {